def rate(origin,userInput):
    if not (isinstance(origin, str)and isinstance(userInput, str)):
        print('The two parameters must be strings.')
        return
    #统计对应位置上打对的字符数量
    right = sum((1 for o, u in zip(origin, userInput) if o==u))
    return round (right/len(origin),2)

s1 = 'Readability counts.'
s2 = 'readability count.'
print(rate(s1,s2)) 